import 'core-js/stable';
import 'regenerator-runtime/runtime';
import Vue from 'vue';
import VueMeta from 'vue-meta';
import App from './App.vue';
import createRouter from './router';
// import createStore from './store';
import 'vant/lib/icon/local.css';
import './assets/css/van-reset.less';
import 'swiper/css/swiper.css';
import './assets/css/mall.less';
import './assets/js/rem.js';
import './assets/js/jssdk-zzb-0.0.1.js';
import global from './utils/global.js';
import {
  formatDate, formatZdf, fixedNumber, formatMoneyUnit, formatPercent, numberComma, yieldFormat, numHidden
} from './utils/filters';

// if (process.env.NODE_ENV !== 'production') {
// const eruda = require('eruda');

// eruda.init();
// }

Vue.use(global);
Vue.use(VueMeta, {
  refreshOnceOnNavigation: true,
});

Vue.filter('formatDate', formatDate);
Vue.filter('formatZdf', formatZdf);
Vue.filter('fixedNumber', fixedNumber);
Vue.filter('formatMoneyUnit', formatMoneyUnit);
Vue.filter('formatPercent', formatPercent);
Vue.filter('numberComma', numberComma);
Vue.filter('yieldFormat', yieldFormat);
Vue.filter('numHidden', numHidden);

const router = createRouter();
// const store = createStore();

new Vue({
  router,
  // store,
  metaInfo() {
    // console.log('metaInfo', store.state.title);
    return {
      title: this.$store.state.title,
      // titleTemplate: '%s-聚宝盆',
      meta: [
        { name: 'keywords', content: '聚宝盆,聚宝盆,聚宝盆,' },
        { name: 'description', content: '聚宝盆,聚宝盆,聚宝盆,聚宝盆,聚宝盆,聚宝盆,聚宝盆,聚宝盆,聚宝盆,' },
      ]
    };
  },
  render: h => h(App),
}).$mount('#app');
